package yunhe.service.impl;

import org.apache.ibatis.session.SqlSession;
import yunhe.dao.UserDao;
import yunhe.entity.UserInfo;
import yunhe.service.UserServers;
import yunhe.util.NewsUtil;
import yunhe.util.SqlSessionFactoryUtil;

public class UserServersImpl implements UserServers {

	private static SqlSession ss=SqlSessionFactoryUtil.getSqlSession();
	private static UserDao udd=ss.getMapper(UserDao.class);
	public int login(String nuName, String nuPass) {
		
		String MD5=NewsUtil.str2md5(nuName+nuPass);
		UserInfo ui=udd.login(MD5);

		if(ui!=null){
			return 1;
		}
		else{
			return -1;
		}
	}

}
